<template>
  <div class="box">
    <div class="box-header">
      <img src="@/assets/large-screen/title/on-one.png" />
      <span class="box-header-title">重点免税商品销售情况</span>
      <span class="date" @click="onPicker">{{ date }}</span>
      <el-date-picker
        class="date-picker"
        ref="pickerRef"
        v-model="date"
        type="month"
        format="YYYY年MM月"
        value-format="YYYY年MM月"
      />
    </div>
    <div class="box-content">
      <TaxBarChart :data="data"></TaxBarChart>
    </div>
  </div>
</template>

<script setup lang="ts">
import { ref } from "vue";
import TaxBarChart from "./TaxBarChart.vue";
const date = ref("2025年5月");
const pickerRef = ref();
function onPicker() {
  console.log("pickerRef", pickerRef.value);
  pickerRef.value && pickerRef.value.focus();
}
const data = [
  { name: "化妆品", value: 32 },
  { name: "香水", value: 28 },
  { name: "酒类", value: 6 },
  { name: "首饰", value: 14 },
  { name: "手表", value: 10 },
  { name: "手机", value: 5 },
];
</script>

<style lang="less" scoped>
.date {
  position: absolute;
  top: 0;
  right: 0px;
  padding-right: 20px;
  font-weight: normal !important;
  cursor: pointer;
  &:hover {
    transform: scale(1.1);
  }
  &::after {
    content: " ";
    position: absolute;
    top: 8px;
    right: 0;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #6b8aa5;
  }
}
:deep(.date-picker) {
  position: absolute;
  top: auto;
  right:90px;
  opacity: 0;
  pointer-events: none;
  width: 20px;
}
</style>
